package com.aic.aicdetactor;

import java.util.HashMap;
import java.util.Map;

public class CacheControl {
	private Map<String, Object> _cahce = new HashMap<String, Object>();

	private static CacheControl _instance = null;

	private CacheControl() {
	}

	public static CacheControl GetInstance() {
		if (CacheControl._instance == null)
			CacheControl._instance = new CacheControl();
		return CacheControl._instance;
	}

	public void addOrUpdate(String key, Object value) {
		synchronized (this) {
			_cahce.put(key, value);
		}
	}

	public Object get(String key) {
		synchronized (this) {
			if (_cahce.containsKey(key)) {
				return _cahce.get(key);
			} else
				return null;
		}
	}

	public static String Key_AvailableSensor = "AvailableSensor";
	public static String Key_SelectedSensor = "SelectedSensor";
	public static String Key_Log = "Log";

	public static String Key_Value_Temperature = "Value_Temperature";
	public static String Key_Value_Effective = "Value_Effective";
	public static String Key_Value_High = "Value_High";
	public static String Key_Value_HighHigh = "Value_HighHigh";
	public static String Key_Value_RPM = "Value_RPM";
	public static String Key_Value_Power = "Value_Power";
	public static String Key_Value_Unit = "Value_Unit";
	
	public static String Key_Value_Slope = "Value_Slope";
	public static String Key_Value_Kurtosis = "Value_Kurtosis";
	public static String Key_Value_WaveFactor = "Value_WaveFactor";
	public static String Key_Value_PeakFactor = "Value_PeakFactor";
	public static String Key_Value_PulseFactor = "Value_PulseFactor";
	public static String Key_Value_ClearanceFactor = "Value_ClearanceFactor";
	public static String Key_Value_KurtosisFactor = "Value_KurtosisFactor";

	public static String Key_Value_Rate1 = "Value_Rate1";
	public static String Key_Value_Rate2 = "Value_Rate2";
	public static String Key_Value_Rate3 = "Value_Rate3";

	public static String Key_Value_Amplitude1 = "Value_Amplitude1";
	public static String Key_Value_Amplitude2 = "Value_Amplitude2";
	public static String Key_Value_Amplitude3 = "Value_Amplitude3";

	public static String Key_Chart_Wave = "Chart_WaveData";
	public static String Key_Chart_FFT = "Chart_FFT";

	public static String Key_Running_Status = "Running_Status";
	
	public static String Key_Value_Txt_Default_E = "Txt_Default_E";
	public static String Key_Value_Txt_Default_A = "Txt_Default_A";
	public static String Key_Value_Txt_Default_V = "Txt_Default_V";
	public static String Key_Value_Txt_Default_D = "Txt_Default_D";
	public static String Key_Value_Txt_Default_T = "Txt_Default_T";
	
	public static String Key_Tempurature_Calibration = "Tempurature_Calibration";
	public static String Key_Tempurature_Voltage = "Tempurature_Voltage";
	public static String Key_Tempurature_Calibration_Point_Index = "Tempurature_Calibration_Point_Index";
	public static String Key_Tempurature_Calibration_Point_Value = "Tempurature_Calibration_Point_Value";
	public static String Key_Sensor_Name_Address = "Sensor_Name_Address";
	public static String Key_Fragment_Page_Value="Fragment_Page_Value";
	public static String Key_Tempurature_Calibration_Schedule = "Tempurature_Calibration_Schedule";
	public static String Key_Tempurature_Calibration_Range = "Tempurature_Calibration_Range";
	public static String Key_Tempurature_Calibration_Step = "Tempurature_Calibration_Step";
	public static String Key_Calibration_Chart = "Key_Calibration_Chart";
	
	public static String Key_Enable_RPM = "Enable_RPM";
	public static String Key_Tempurature_Print = "Tempurature_Print";
}
